package de.jmda.sample.xml.p1;

import java.util.ArrayList;
import java.util.Collection;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;

import de.jmda.sample.xml.p2.XMLType2;

@XmlRootElement
public class XMLType1
{
	private static int instanceCounter = 0;

	@XmlAttribute
	private String id = "" + instanceCounter++;

	@XmlElementWrapper
	@XmlElements
	(
			@XmlElement(name="child")
	)
	private Collection<XMLType2> children = new ArrayList<XMLType2>();

	public Collection<XMLType2> getChildren()
  {
  	return children;
  }
}